<div class="breadcrumb">
	<div class="block-section clearfix">
    	<div class="pull-left">
        	<h2><?php echo $this->translate('CATEGORY_MANAGEMENT'); ?></h2>
        </div>
        <div class="pull-right">
        	<a href="<?php echo $this->url(array('module' => $this->moduleName, 'controller' => $this->controllerName, 'action' => 'add'), 'default', true); ?>" class="btn btn-success"><i class="icon-plus icon-white"></i> <?php echo $this->translate('ADD'); ?></a>
        </div>
	</div>
	<div class="form-horizontal well">
            <form id="admin_form_list" accept-charset="utf-8" method="post" action="">
                <div class="block-section clearfix">
                    <div class="control-group pull-left">
                        <div class="pull-left">
                            <div class="btn-group">
                                <button data-toggle="dropdown" class="btn dropdown-toggle"> <?php echo $this->translate('BULK_ACTION'); ?>  <span class="caret"></span></button>
                                <ul class="dropdown-menu">
                                    <li><a id="bulk_action_delete" href="javascript:void(0);" rel="<?php echo $this->url(array('module' => $this->moduleName, 'controller' => $this->controllerName, 'action' => 'bulk', 'select' => 'delete'), 'default', true); ?>"><i class="icon-trash"></i>  <?php echo $this->translate('DELETE'); ?></a></li>
                                    <li><a id="bulk_action_published" href="javascript:void(0);" rel="<?php echo $this->url(array('module' => $this->moduleName, 'controller' => $this->controllerName, 'action' => 'bulk', 'select' => 'published', 'value' => 1), 'default', true); ?>"><i class="icon-ok"></i>  <?php echo $this->translate('PUBLISH'); ?></a></li>
                                    <li><a id="bulk_action_unpublished" href="javascript:void(0);" rel="<?php echo $this->url(array('module' => $this->moduleName, 'controller' => $this->controllerName, 'action' => 'bulk', 'select' => 'published', 'value' => 0), 'default', true); ?>"><i class="icon-remove"></i>  <?php echo $this->translate('UN_PUBLISH'); ?></a></li>
                                </ul>
                            </div>
                        </div>
                        <div class="pull-right">
                            <div class="span">
                                <select id="admin_form_list_published" name="published">
                                    <option value="" <?php if($this->published === '') echo 'selected="selected"'; ?>><?php echo $this->translate('SHOW_ALL_STATUS'); ?></option>
                                    <option value="1" <?php if($this->published === 1) echo 'selected="selected"'; ?>><?php echo $this->translate('PUBLISH'); ?></option>
                                    <option value="0" <?php if($this->published === 0) echo 'selected="selected"'; ?>><?php echo $this->translate('UN_PUBLISH'); ?></option>
                                </select>
                            </div>
                            <div class="span">
                                <button class="btn btn-primary" type="submit"><i class="icon-filter icon-white"></i> <?php echo $this->translate('FILTER'); ?></button>
                                <button class="btn" type="reset"><i class="icon-refresh"></i> <?php echo $this->translate('RESET'); ?></button>
                            </div>
                        </div>
                    </div>
                    <div class="control-group pull-right">
                        <div class="form-inline">
                            <input placeholder="<?php echo $this->translate('ENTER_KEYWORD'); ?>" type="text" class="input-medium search-query" name="keyword" value="<?php echo $this->keyword; ?>" />
                            <button class="btn btn-primary" type="submit"><i class="icon-search icon-white"></i> <?php echo $this->translate('SEARCH'); ?></button>
                        </div>
                    </div>
                </div>
                <table class="table table-bordered table-striped">
                    <thead>
                        <tr>
                            <th><input type="checkbox" id="check_all_items" name="checkAllItems" /></th>
                            <th width="50%"><?php echo $this->translate('NAME'); ?></th>
                            <th><?php echo $this->translate('PUBLISHED'); ?></th>
                            <th><?php echo $this->translate('CREATED_DATE'); ?></th>
                            <th><?php echo $this->translate('MODIFIED_DATE'); ?></th>
                            <th><?php echo $this->translate('ACTION'); ?></th>
                        </tr>
                    </thead>
                    <tbody>
                    <?php
                    if($this->total == 0) {
                        ?>
                        <tr>
                            <td colspan="6"><?php echo $this->translate('RECORD_NOT_FOUND'); ?></td>
                        </tr>
                        <?php
                    }
                    else {
                        foreach($this->items as $item) {
                            $link = $this->url(array('module' => $this->moduleName, 'controller' => $this->controllerName, 'action' => 'edit', 'id' => $item['id']), 'default', true);
                            $dlink = $this->url(array('module' => $this->moduleName, 'controller' => $this->controllerName, 'action' => 'delete', 'id' => $item['id']), 'default', true);
                            ?>
                            <tr>
                                <td><input class="list_items" type="checkbox" value="<?php echo $item['id']; ?>" name="list_items[]" /></td>
                                <td><a href="<?php echo $link;?>" title="<?php echo $item['name'];?>"><?php echo $item['name'];?></a></td>
                                <td><?php $published = ($item['published'] == 1) ? '<i class="icon-ok"></i>' : '<i class="icon-remove"></i>'; echo $published; ?></td>
                                <td><?php echo date($this->config->datetime->format->datetime, strtotime($item['created_date'])); ?></td>
                                <td><?php echo date($this->config->datetime->format->datetime, strtotime($item['modified_date'])); ?></td>
                                <td>
                                    <a href="<?php echo $link;?>" class="btn btn-primary"><i class="icon-edit icon-white"></i></a>
                                    <a href="<?php echo $dlink;?>" class="btn btn-danger"><i class="icon-trash icon-white"></i></a>
                                </td>
                            </tr>
                            <?php
                        }
                        ?>
                        <?php
                    }
                    ?>
                    </tbody>
                </table>
            </form>
            <?php
            if(ceil($this->total / $this->item_per_page) > 1) {
                echo $this->pagination($this->pagination_config)->create_links();
            }
            ?>
	</div>
</div>